package cn.yhbk.web.modules.manager.Mapper;

import cn.yhbk.web.modules.manager.Pojo.DTO.Apply.ApplyDto;
import cn.yhbk.web.modules.manager.Pojo.DTO.Apply.ApplyExcelDto;

import cn.yhbk.web.modules.manager.Pojo.DTO.Apply.TbApplyDto;
import cn.yhbk.web.modules.manager.Pojo.DTO.Apply.TbApplyDto;
import cn.yhbk.web.modules.manager.Pojo.Entity.TbApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 奖学金申请表 Mapper 接口
 * </p>
 *
 * @author 有何不可
 * @since 2023-08-05
 */
@Mapper
@Repository
public interface TbApplyMapper extends BaseMapper<TbApply> {

    TbApplyDto queryApplyById(Long id);

    List<TbApplyDto> queryApplyDto();

    Boolean insertApply(TbApply tbApply);

    Boolean updateApplyById(TbApply tbApply);

    Boolean deleteApplyById(Long id);

    Integer queryManagerApplyNum(@Param("typeId") Long typeId,
                          @Param("scholarshipId") Long scholarshipId,
                          @Param("year") String year,
                          @Param("jobNumber") Long jobNumber,
                          @Param("collegeId") Long collegeId,
                          @Param("majorId") Long majorId,
                          @Param("status") Integer status);

    List<TbApplyDto> queryManagerApplyPage(@Param("i") int i,
                                    @Param("pageSize") Integer pageSize,
                                    @Param("typeId") Long typeId,
                                    @Param("scholarshipId") Long scholarshipId,
                                    @Param("year") String year,
                                    @Param("jobNumber") Long jobNumber,
                                    @Param("collegeId") Long collegeId,
                                    @Param("majorId") Long majorId,
                                    @Param("status") Integer status);

    List<ApplyExcelDto> queryApplyExcel( @Param("name") String name,
                                         @Param("typeId") Long typeId,
                                         @Param("scholarshipId") Long scholarshipId,
                                         @Param("year") String year,
                                         @Param("jobNumber") Long jobNumber,
                                         @Param("majorId") Long majorId,
                                         @Param("status") Integer status);

    List<ApplyDto> queryApplyList(@Param("page") int page,
                                  @Param("pageSize") Integer pageSize,
                                  @Param("stuId") Long stuId,
                                  @Param("year") String year,
                                  @Param("scholarshipId") Long scholarshipId,
                                  @Param("status") Integer status,
                                  @Param("typeId") Long typeId);

    Integer queryApplyNum(@Param("stuId") Long stuId,
                          @Param("year") String year,
                          @Param("scholarshipId") Long scholarshipId,
                          @Param("status") Integer status,
                          @Param("typeId") Long typeId);

    Integer countIsApply(@Param("stuId") Long stuId,
                         @Param("year") String year,
                         @Param("scholarshipId") Long scholarshipId);
}
